home *** CD-ROM | disk | FTP | other *** search
/ VisualFX for ImageFX / VisualFX for Image FX 2.adf / Files / SetUp / 02 / 01.rexx next >
Encoding:
OS/2 REXX Batch file  |  1997-04-12  |  6.0 KB  |  291 lines

  1. /*
  2.                                  Visual FX
  3.                                     For
  4.                                  Image FX
  5.                                SetUp Script
  6.                            Written By J.L. White
  7.  
  8.                          (C)1997 Merlin's Software
  9.  
  10. */
  11. parse arg Num
  12. options results
  13. address "IMAGEFX.1"
  14.  
  15.  
  16.     Gadget.1 = 'Select Type Of Flames!'
  17.     Gadget.2 = 'Wood'
  18.     Gadget.3 = 'Gas'
  19.     Gadget.4 = 'None'
  20.     ListRequest 4 Gadget
  21.     Type = 2
  22.     if result = 2 then Type = 0
  23.     if result = 3 then Type = 1
  24.     if result = 4 then Type = 2
  25.  
  26.     Style = 0
  27.     if Type < 2 then do
  28.         Gadget.1 = 'Select Flame Options!'
  29.         Gadget.2 = 'Growing & Radial Out'
  30.         Gadget.3 = 'Growing & Radial In'
  31.         Gadget.4 = 'Same Size & Radial In'
  32.         Gadget.5 = 'Same Size & Radial Out'
  33.         ListRequest 5 Gadget
  34.         if result = 2 then Style = 0
  35.         if result = 3 then Style = 1
  36.         if result = 4 then Style = 2
  37.         if result = 5 then Style = 3
  38.         end
  39.  
  40.     FireNum = 50
  41.     if Style > 1 then do
  42.         NumA = 1
  43.         NumB = 100
  44.         NumC = 30
  45.         RequestSlider '"Enter Thickness Of Flame!"' NumA NumB NumC
  46.         FireNum = Result
  47.         end
  48.  
  49.     XOff = 0
  50.     YOff = 0
  51.  
  52.     NumA = 1
  53.     NumB = 50
  54.     NumC = 5
  55.  
  56.     RequestSlider '"Enter Amount For Feathering!"' NumA NumB NumC
  57.     STNum = Result
  58.  
  59.  
  60.  
  61.     Gadget.1 = 'Select Circle Movement!'
  62.     Gadget.2 = 'Zoom Out'
  63.     Gadget.3 = 'Zoom In'
  64.     ListRequest 3 Gadget
  65.     ZoomType = 0
  66.     if result = 2 then ZoomType = 0
  67.     if result = 3 then ZoomType = 1
  68.  
  69.     Gadget.1 = 'Select Circle Options!'
  70.     Gadget.2 = 'Start From Center'
  71.     Gadget.3 = 'User Defined Point'
  72.     ListRequest 3 Gadget
  73.     CircleType = 0
  74.     if result = 2 then CircleType = 0
  75.     if result = 3 then do
  76.         CircleType = 1
  77.         RequestNotify 'Select Temporary File For Positioning!'
  78.         call GetStart()
  79.         call LoadA()
  80.         call PickPoint()
  81.         end
  82.  
  83.  
  84.  
  85. call open TempFile,"VFXIFX:TempDrawer/"strip(Num),W
  86. call writeln TempFile,STNum
  87. call writeln TempFile,Type
  88. call writeln TempFile,Style
  89. call writeln TempFile,FireNum
  90. call writeln TempFile,ZoomType
  91. call writeln TempFile,CircleType
  92. call writeln TempFile,XOff
  93. call writeln TempFile,YOff
  94. call close TempFile
  95. exit
  96.  
  97. PickPoint:
  98.     Menu ToolBox
  99.     DrawTool "FreeDraw"
  100.     RequestNotify "Click On X & Y Position For Center Of Circle!"
  101.     HidePanel
  102.     Undo On
  103.     WaitFor SELECTDOWN
  104.     parse var result X1 Y1
  105.     WaitFor SELECTUP
  106.     parse var result X2 Y2
  107.     Undo
  108.     ShowPanel
  109.     Undo Off
  110.     XOff = strip(X1)
  111.     YOff = strip(Y1)
  112.     RequestResponse "Is The Point You Have Selected Correct?"
  113.     if rc ~= 0 then call PickPoint()
  114.  
  115. return
  116.  
  117.  
  118.  
  119. LoadA:
  120.     if IAType = 0 then do
  121.         LoadBuffer PicAName Force Start
  122.         end
  123.     if IAType = 1 then do
  124.         LoadBuffer PicAName Force 1
  125.         end
  126.     if IAType = 2 then do
  127.         LoadBuffer PicAName Force
  128.         end
  129.     if IAType = 3 then do
  130.         LoadBuffer PicAName""right(Start,3,'0') Force
  131.         end
  132. return
  133.  
  134.  
  135. GetA:
  136.  if IAType = 0 then do
  137.     call Switcher(TOSW)
  138.     PicAName = GetFile("Select Flyer Clip For ImageA!  ",DriveName)
  139.     Name = GetFileName(PicAName)
  140.     if Name = "" then do
  141.         Address FLY_1 OK_TEXT " OK "
  142.         Title = "You Must Enter A Valid Clip Name To Use!"
  143.         Address FLY_1 FYINT Title
  144.         Address FLY_1 Quit
  145.         call Switcher(TOWB)
  146.         exit
  147.         end
  148.     Address FLY_1 SetFileName PicAName
  149.     Address FLY_1 GetClipLength PicAName
  150.     End = result
  151.     Start = 0
  152.     Address FLY_1 Program "5"
  153.     Address FLY_1 StartNum Start
  154.     Address FLY_1 EndNum End
  155.     Address FLY_1 CurrentNum "0"
  156.     Address FLY_1 GetTimeNT "Select A Range Of Frames To Process!"
  157.     Start = word(result,1)*2
  158.     End = word(result,2)*2
  159.     Start  = Start + 1
  160.     End = End +2
  161.     call addlib('PROJECT_REXX_PORT' , 0)
  162.     call addlib(TOASTERLIB,0)
  163.     call Switcher(TOWB)
  164.     address command "C:Wait 1"
  165.     ScreenToFront
  166.     end
  167.    if IAType = 1 then do
  168.     RequestFile '"Select Flyer Still For ImageA!"' DriveName ' '
  169.     PicAName = result
  170.     Name = GetFileName(PicAName)
  171.     if Name = "" then do
  172.         Title = "You Must Enter A Valid Name To Use!"
  173.         RequestNotify Title
  174.         if FlyOn = 1 then Address FLY_1 Quit
  175.         exit
  176.         end
  177.     Start = 1
  178.     end
  179.    if IAType = 2 then do
  180.     RequestFile '"Select FileName For ImageA!"' 'SYS:' ' '
  181.     PicAName = result
  182.     Name = GetFileName(PicAName)
  183.     if Name = "" then do
  184.         Title = "You Must Enter A Valid Name To Use!"
  185.         RequestNotify Title
  186.         if FlyOn = 1 then Address FLY_1 Quit
  187.         exit
  188.         end
  189.     Start = 1
  190.     end
  191.    if IAType = 3 then do
  192.     RequestFile '"Select BaseName For ImageA! "' 'SYS:' ' '
  193.     PicAName = result
  194.     Name = GetFileName(PicAName)
  195.     if Name = "" then do
  196.         Title = "You Must Enter A Valid Name To Use!"
  197.         RequestNotify Title
  198.         if FlyOn = 1 then Address FLY_1 Quit
  199.         exit
  200.         end
  201.     Start = 1
  202.     end
  203. return
  204.  
  205. GetFile:
  206.     parse Arg Title, Path
  207.     Address FLY_1 SetString Path
  208.     Address FLY_1 GetFileNameNT Title
  209. return result
  210.  
  211. GetFileName: procedure  
  212.    ARG CompleteName
  213.    c = lastpos("/",CompleteName)
  214.    if c = 0 then c = lastpos(":",CompleteName)
  215.    return substr(CompleteName, c + 1)
  216.  
  217. CloseStuff:
  218.     Address FLY_1 Quit
  219.     call remlib('ToasterARexx.port')
  220.     call remlib('PROJECT_REXX_PORT')
  221. return
  222.  
  223.  
  224. OpenFlyStuff:
  225.     FlyOn = 1
  226.     address command "run VFXIFX:FLY" 
  227.     do while (POS('FLY_1',SHOW('Ports')) = 0)
  228.         address command "wait 1"
  229.         end
  230.     TOASTERLIB="ToasterARexx.port"
  231.     call remlib('ToasterARexx.port')
  232.     call remlib('PROJECT_REXX_PORT')
  233.     call addlib('PROJECT_REXX_PORT' , 0)
  234.     call addlib(TOASTERLIB,0)
  235.     DriveName = FindDrive()
  236. return
  237.  
  238.  
  239. FindDrive:
  240.     address command "C:Info >RAM:DriveList"
  241.     call open TempFile,"RAM:DriveList",R
  242.     do until eof(TempFile)
  243.         line = readln(TempFile)
  244.         parse var line Drive" "Rest
  245.         if Drive = "FA0:" then 
  246.             FlyVolume = word(Rest,7)":"
  247.     end
  248.     call close TempFile
  249.     address command "Delete >NIL: RAM:DriveList"
  250. return FlyVolume
  251.  
  252.  
  253. GetStart:
  254.     if exists("libs:flyer.library") then do
  255.     if (POS('PROJECT_REXX_PORT',SHOW('Ports')) =0) then do
  256.         RequestNotify 'Flyer Must Be Running First!'
  257.         exit
  258.         end
  259.     call OpenFlyStuff()
  260.  
  261.  
  262.     Gadget.1 = 'D/110/22/120/ImageA Type/4/FLYER CLIP/FLYER STILL/FRAME/SEQUENCE'
  263.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 250 60
  264.     if rc ~= 0 then do
  265.         call CloseStuff()
  266.         exit 0
  267.         end
  268.     else do
  269.         IAType = RESULT.1
  270.            end
  271.  
  272.     call GetA()
  273. end
  274. else do
  275.     Gadget.1 = 'D/110/22/120/ImageA Type/2/FRAME/SEQUENCE'
  276.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 250 60
  277.     if rc ~= 0 then do
  278.         call CloseStuff()
  279.         exit 0
  280.         end
  281.     else do
  282.         IAType = RESULT.1+2
  283.            end
  284.  
  285.     call GetA()
  286. end
  287.  
  288. if FlyOn = 1 then
  289.     call CloseStuff()
  290. return
  291.